# Copyright (c) 2019 Presto Labs Pte. Ltd.
# Author: xguo

import datetime

from coin.exchange.binance.kr_rest.currency import BinanceCurrency
from coin.exchange.binance_futures_swap.order_gateway import BinanceSwapFuturesOrderGateway
from coin.strategy.mm.subscription import SubscriptionRequest
from coin.strategy.mm.base.order_subsystem import BaseOrderSubsystem


class BinanceSwapFuturesOrderSubsystem(BaseOrderSubsystem):
  OrderSubReq = SubscriptionRequest('Futures', 'Binance', None)
  OrderGateway = BinanceSwapFuturesOrderGateway
  _delay_notify_order_gateway_reset = datetime.timedelta(seconds=5)
  _use_og_params = True

  def __init__(self, *args, subscribe_bnb=False, **kwargs):
    super().__init__(*args, **kwargs)
    if subscribe_bnb:
      self._currencies.append(BinanceCurrency.FromStrCurrency('BNB'))
